﻿<UserControl x:Class="SkypeStudio.Controls.Views.ContactList"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                  xmlns:c="clr-namespace:SkypeStudio.Controls.Converters"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <StackPanel Visibility="{Binding IsNoySkypeProcessAttachedReady, Converter={x:Static c:BooleanToVisibilityConverter.Default}}">
            <TextBlock Text="You hane not login Skype. You need to open Skype and go to login."/>
        </StackPanel>
        <!--<ListView Name="lbContxctList"  ItemsSource="{Binding ContactList}" SelectionMode="Single"  >-->
            <!--<ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <Image Height="25" Width="25" HorizontalAlignment="Left"  VerticalAlignment="Center">
                            <Image.Source> 
                                <BitmapImage UriSource="{Binding OnlineStatus, Converter={x:Static c:OnlineStatuImageConvertor.Default}}"></BitmapImage>
                            </Image.Source>
                        </Image>
                        <TextBlock Text="{Binding Name}"  VerticalAlignment="Center" Margin="15,5,5,5"/>
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>-->
            <!--<ListView.View>
                <GridView>
                    <GridViewColumn Width="140" 
               DisplayMemberBinding="{Binding GameName}">
                        <GridViewColumnHeader Click="SortClick" 
                                 Tag="GameName" 
                                 Content="Game Name" />
                    </GridViewColumn>
                    <GridViewColumn Width="140" 
               DisplayMemberBinding="{Binding Creator}">
                        <GridViewColumnHeader Click="SortClick" 
                                 Tag="Creator" 
                                 Content="Creator" />
                    </GridViewColumn>
                    <GridViewColumn Width="140" 
               DisplayMemberBinding="{Binding Publisher}">
                        <GridViewColumnHeader Click="SortClick" 
                                 Tag="Publisher" 
                                 Content="Publisher" />
                    </GridViewColumn>
                </GridView>
            </ListView.View>-->

        <!--</ListView>-->
      
        <DataGrid AutoGenerateColumns="False"  ItemsSource="{Binding ContactList}" SelectionMode="Extended"  SelectionUnit="FullRow"  SelectedItem="{Binding SelectedContact, Mode=TwoWay}"
                  GridLinesVisibility="None" IsReadOnly="True"  Visibility="{Binding IsSkypeProcessAttachedReady, Converter={x:Static c:BooleanToVisibilityConverter.Default}}" >
            <DataGrid.InputBindings>
                <MouseBinding   Gesture="LeftDoubleClick" Command="{Binding ListMouseDoubleClickCommand}" />
            </DataGrid.InputBindings>
            <DataGrid.Columns>
                <DataGridTemplateColumn CanUserSort="True" SortMemberPath="OnlineStatus" >
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate >
                            <Image Height="25" Width="25" HorizontalAlignment="Left"  VerticalAlignment="Center" 
                                   Source="{Binding OnlineStatus, Converter={x:Static c:OnlineStatuImageConvertor.Default}}">
                            </Image>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn> 
                <DataGridTemplateColumn Header="Contact" CanUserSort="True" SortMemberPath="Name" Width="*"  >
                   
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate >
                            <TextBlock Text="{Binding Name}"  VerticalAlignment="Center" Margin="15,5,5,5"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</UserControl>
